﻿#region Using

using GameCommon.Converters;
using GameCommon.Manager;
using GameCommon.ManagerInterfaces;
using GameCommon.ServiceInterfaces;
using GameCommon.Services;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using StructureMap;

#endregion

namespace GameCommon
{
    public static class GameCommonRegistry
    {
        public static void Register()
        {
            ObjectFactory.Configure(x => x.For<IPathService>().Use<PathService>());
            ObjectFactory.Configure(x => x.For<IFileService>().Use<FileService>());
            ObjectFactory.Configure(x => x.For<IColorService>().Use<ColorService>());
            ObjectFactory.Configure(x => x.For<ISplineEffectService>().Use<SplineEffectService>());
            ObjectFactory.Configure(x => x.For<IFontService>().Use<FontService>());
            ObjectFactory.Configure(x => x.For<IDrawingService>().Use<DrawingService>());
            ObjectFactory.Configure(x => x.For<IComponentModifier>().Use<ComponentModifier>());
            ObjectFactory.Configure(x => x.For<ILoadingService>().Use<LoadingService>());

            ObjectFactory.Configure(x => x.For<ITypeConverter<string, Color>>().Use(new ColorConverter()));
        }

        public static void Register(Microsoft.Xna.Framework.Content.ContentManager content, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
        {
            ObjectFactory.Configure(x => x.For<IContentManager>().Use(new ContentManager(content, graphicsDevice)));
            ObjectFactory.Configure(x => x.For<IRenderManager>().Use(new RenderManager(spriteBatch)));
            ObjectFactory.Configure(x => x.For<IFontManager>().Use(new FontManager()));
            ObjectFactory.Configure(x => x.For<IKeyboardManager>().Use(new KeyboardManager()));
            ObjectFactory.Configure(x => x.For<IMouseManager>().Use(new MouseManager()));
        }

    }
}